package rentcar.web.converters;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import rentcar.domain.Request;
import rentcar.service.RequestService;

 
@Component
public class StringToRequestConverter implements Converter<String, Request> {

	 @Autowired
		private RequestService requestService;	

	  @Override
	    public Request convert(String requestId) {
	        return requestService.getRequestByID(new Long(requestId));	 
	  }
	
}
